#ifndef __SERVER_H_
#define __SERVER_H_

/**
* @file server.h
* @describe server
* @author gaoyuelong
* @date 2022/1/3 
*/

#include <muduo/net/TcpServer.h>
#include <muduo/net/EventLoop.h>

using namespace muduo;
using namespace muduo::net;

class Server 
{
public:
    Server(EventLoop *loop, 
    const InetAddress &listenAddr,
    const string &nameArg);

    void start();
private:

    void onConnection(const TcpConnectionPtr &);
    void onMessage(const TcpConnectionPtr &, Buffer *, Timestamp);

    TcpServer m_server;
    EventLoop *m_pLoop;
};

#endif